import React from 'react';
import { Menu, Dropdown } from 'antd';
import { CaretDownOutlined } from '@ant-design/icons';

export default class UserCenterGate extends React.Component {
    constructor(props) {
        super(props);
        this.state = {};
        this.menu = (
            <Menu onClick={(e) => this.props.onMenuClick(e)}>
                <Menu.Item key="setMenu"><span>菜单配置</span></Menu.Item>
                {/* <Menu.Item key="setCommon"><span>通用设置</span></Menu.Item> */}
                <Menu.Divider />
                <Menu.Item key="logout"><span>退出登录</span></Menu.Item>
            </Menu>
        );
    }

    render() {
        return (
            <div className="user-center-gate">
                <img alt="头像" className="user-center-gate-avatar" src={require('static/avatar.jpeg')} />
                <Dropdown overlay={this.menu}>
                    <div>
                        <p className="user-center-gate-username">陈晓怡0207</p>
                        <CaretDownOutlined />
                    </div>
                </Dropdown>
            </div>
        )
    }
}
export { UserCenterGate };